package com.carleasoft.mps.adu.business.role.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.carleasoft.mps.adu.business.role.bean.entity.AuthorityDataPermsEntity;
import com.carleasoft.mps.adu.business.role.bean.vo.AuthorityDataPermsVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 数据权限编码集合表 Mapper 接口
 * </p>
 *
 * @author ztm
 * @since 2021-09-11
 */
@Repository
public interface AuthorityDataPermsDao extends BaseMapper<AuthorityDataPermsEntity> {
    /**
     * 新增数据权限编码对应的业务编码
     * @param authorityDataPermsEntities
     * @return int
     */
    int batchAddDataPermission(@Param("authorityDataPermsEntities") List<AuthorityDataPermsEntity> authorityDataPermsEntities);

    /**
     * 删除数据权限与业务code关系
     * @param roleCode
     * @return int
     */
    int deleteDataPermissions(@Param("roleCode") String roleCode);

    /**
     * 通过code集合查询权限
     * @param roleCodes
     * @return
     */
    List<AuthorityDataPermsVo> selectDataPermissionsByRoleCodes(@Param("roleCodes") List<String> roleCodes);
//    /**
//     * 查数据权限
//     * @param dataCode
//     * @return int
//     */
//
//    List<String> selectDataPermissionsByDataCode(@Param("dataCode") String dataCode);


}
